import React, { Component } from "react";

export default class App extends Component {
  a = 100;
  myText = React.createRef();
  render() {
    return (
      <div>
        <h2>07</h2>
        <input type="text" placeholder="输入代办事项" ref={this.myText} />
        <button
          onClick={(evt) => {
            console.log("click", evt);
            console.log("获取 input值", this.myText.current.value);
          }}
        >
          Add1
        </button>
      </div>
    );
  }
}
